#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include "searcher.hpp"

const std::string input = "data/raw_html/raw.txt";

int main()
{
    ns_searcher::Searcher searcher;
    searcher.InitSearcher(input);

    char buffer[1024];
    while (true)
    {
        std::cout << "please enter# ";
        fgets(buffer, sizeof buffer, stdin);
        buffer[strlen(buffer)] = '\0';
        std::string output;
        searcher.Search(buffer, &output);
        std::cout << output << std::endl;
    }

    // // 测试 Split
    // std::string str = "hello\3I\3love\3the\3world";
    // std::vector<std::string> results;

    // ns_util::StringUtil::Split(str, &results, "\3");

    // for (int i = 0; i < results.size(); i++)
    // {
    //     std::cout << results[i] << std::endl;
    // }

    return 0;
}